"""delete_foreign_key_from_rooms

Revision ID: e48343556bf2
Revises: 85ffdd9d4d15
Create Date: 2025-06-13 10:36:37.248724

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision: str = 'e48343556bf2'
down_revision: Union[str, None] = '85ffdd9d4d15'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(op.f('rooms_ibfk_2'), 'rooms', type_='foreignkey')
    op.drop_column('rooms', 'group_id')
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('rooms', sa.Column('group_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.create_foreign_key(op.f('rooms_ibfk_2'), 'rooms', 'groups', ['group_id'], ['id'])
    # ### end Alembic commands ###
